import 'package:flutter/material.dart';
import 'package:open_source_china/constants/constants.dart';
import 'package:open_source_china/utils/Icon.dart';

// 自定义NavigationBarItem
class NavigationBarItemView {
  final BottomNavigationBarItem item;
  final String title;
  final int iconData;
  final Color color;
  final Color activeColor;

  NavigationBarItemView(
      {@required this.title,
      @required this.iconData,
      @required this.color,
      this.activeColor = const Color(AppColors.APP_THEME)})
      : assert(title != null),
        assert(iconData != null),
        assert(color != null),
        // final 标注可在断言后初始化赋值
        item = BottomNavigationBarItem(
            icon: iconBuild(icondata: iconData, color: color),
            activeIcon: iconBuild(icondata: iconData, color: activeColor),
            // title: Text(title));
            label: title);
}
